#pragma once
#include "..\Common\Global.h"

class Lexer_Ch;
class Lexer_Str;

class Lexer_Result;

class Lexer_MemoryManager : public Combinator_MemoryManager<LPTSTR,Lexer_Result>
{
public:
	~Lexer_MemoryManager()
	{
		Destroy();
	}

	void AddCh(Lexer_Ch* ptr)
	{
		ChList.Add(ptr);
	}

	void AddStr(Lexer_Str* ptr)
	{
		StrList.Add(ptr);
	}

	void AddString(LPTSTR ptr)
	{
		StringList.Add(ptr);
	}

	void Destroy();
protected:
	List<Lexer_Ch*> ChList;
	List<Lexer_Str*> StrList;
	List<LPTSTR> StringList;
};

extern Lexer_MemoryManager g_Lexer_MemoryManager;